Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

line-column-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

line-column-path

Parse and stringify file paths with line and column like `unicorn.js:8:14`

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
73K
decreased by-21.88%
Maintainers
1
Weekly downloads
 
Created
Source

line-column-path Build Status

Parse and stringify file paths with line and column like unicorn.js:8:14

Install

$ npm install line-column-path

Usage

const lineColumnPath = require('line-column-path');

const parsed = lineColumnPath.parse('unicorn.js:8:14');
//=> {file: 'unicorn.js', line: 8, column: 14}

lineColumnPath.stringify(parsed);
//=> 'unicorn.js:8:14'

API

.parse(input)

input

Type: string | object

File path to parse.

Can also be an object that you want to validate and normalize.

.stringify(path, [options])

path

Type: object

Object with a .file property and optionally a .line and .column property.

options

Type: object

file

Type: boolean
Default: true

Output the file path.

Setting this to false will result in 8:18 instead of unicorn.js:8:14.

column

Type: boolean
Default: true

Output the column.

Setting this to false will result in unicorn.js:8 instead of unicorn.js:8:14.

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 22 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc